import { MtEntity } from '../mt'

export interface ICheckingItem {
	/**终端e164 */
	mt_e164: string
	/**终端名称 */
	mt_name: string
	/**发生时间 */
	event_time: string
	/**恢复时间 */
	recovery_time: string
	/**异常类型 */
	description: string
	/**解决方案 */
	suggestion: string
	/**异常类型 */
	type: string
}

export type FetchOpsApi = {
	total: number
	info: ICheckingItem[]
}
export type SysMsg =
	| 'mcc_sysmsg_mtapplyadmin'
	| 'mcc_sysmsg_mt_apply_cancel_mute'
	| 'mcc_sysmsg_mtapplyspeaker'
	| 'mcc_sysmsg_mtapplydiscuss'
	| 'mcc_sysmsg_timeleft'
	| 'mcc_sysmsg_mtapplymix'
	| 'err_mcu_no_idle_mix'
	| 'err_mcu_nureslimited'
	| 'err_mcu_nu_sfuabnormal'
	| 'err_mcu_mtreject'
	| 'err_mcu_addedmt_inconf'
	| 'err_mcu_mtbusy'
	| 'err_mcu_mtunreachable'
	| 'err_mcu_rollcall_callerleft'
	| 'err_mcu_rollcall_calleeleft'
	| 'err_mcu_selaudbasisnotenough'
	| 'err_mcu_selmediabasisnotenough'
	| 'err_mcu_vmp_stop'
	| 'err_mcu_mix_stop'
	| 'err_mcu_bas_stop'
	| 'err_mcu_vrs_disc_rejected'
	| 'err_mcu_illegal_char'
	| 'err_mcu_vrs_break'
	| 'err_mcu_file_notfound'
	| 'err_mcu_mt_overconfsupport'
	| 'err_mcu_mtnovidsrc'
	| 'err_mcu_mtbusy_ocp'
	| 'err_mcu_mt_notreg'
	| 'err_mcu_discussautochange2specmix'
	| 'err_mcu_mmcuspecmix_vac'
	| 'err_mcu_nu_exception'
	| 'err_mcu_normal_drop'
	| 'err_mcu_callsmcufailed_busy'
	| 'err_mcu_chairman_drop'
	| 'err_mcu_mmcu_drop'
	| 'err_mcu_authfailed_drop'
	| 'err_mcu_mtbackgroudtask_failed'
	| 'err_mcu_genrandomfailed'
	| 'err_mcu_overmaxmixerchnnl'
	| 'err_mcu_vrs_genrandomfailed'
	| 'err_mcu_client_disconnect'
	| 'err_mcu_client_connect'
	| 'err_mcu_protocollimite_failed'
	| 'err_mcu_mt_exceedmaxconflicense'
	| 'err_mcu_conf_reject_dismatchencypt'
	| 'err_mcu_overmedialicense'
	| 'err_mcu_regtypenomatch_failed'
	| 'err_mcu_workerreslimited'
	| 'err_mcu_mediaresnotenough'
	| 'err_mcu_discussioner_overmaxnum'
	| 'err_mcu_audience_overmaxnum'
	| 'err_mcu_audience_conf_failed'
	| 'err_mcu_apply_brdbas_fail'
	| 'err_mix_apply'
	| 'err_abas_apply'
	| 'err_vmp_apply'
	| 'err_vbas_apply'
	| 'err_port_getvidcodec'
	| 'err_port_getmerge'
	| 'err_audiencenum_exceed'
	| 'err_create_audconf_failed'
	| 'err_portbas_create'
	| 'err_mcu_mt_otherconfforcecall'
	| 'err_mau_audience_reachmaxnum'
	| 'err_mcu_confnodisturb'
	| 'err_mcu_mt_confopenmodeclose'
	| 'err_mcu_dssclient_disconnect'
	| 'err_mcu_mtadr_disconnect'
	| 'err_mcu_mediaresexceed'
	| 'err_mcu_noconf'
	| 'err_mcu_vmp_lackofdecodingability'
	| 'err_mcu_mtadp_disconnect'
	/**会管后台自己编的 */
	| 'err_mcu'
	| 'err_css'
	| 'err_tvwall'
	| 'err_mcu_media'
	| 'err_resource'
	| 'err_mcu_resource'
	| 'err_unknown'
	| ''
	/**大写的目前确认下来，大概率是监控独有的 */
	| 'err_mcu_audiomtnomonitorsrc'
	| 'err_mcu_casdbasisnotenough'
	| 'err_mcu_spymtstate_waitfree'
	// | 'ERR_MCU_SPYMTSTATE_UNKNOWNERROR'
	/**特殊的 vrs 终端录像，后台自己定义的几个错误码 */
	| 'err_start_mt_rec_20801'
	| 'err_start_mt_rec_20435'
	| 'err_start_mt_rec_20063'
	| 'err_start_mt_rec_20856'
	| 'err_start_mt_rec_20857'
	| 'err_start_mt_rec_21744'

export interface SystemInfoItem {
	id: string
	created_at: string
	type: SysMsg
	time_left: string
	operation_data: string
	error_code: number
	operation_user?: {
		account: string
		name: string
		mt_key?: string
		mt_id?: string
		account_type?: number
	}
}
export interface CometdMessage {
	id?: string
	created_at?: string
	type: SysMsg | Msg
	time_left?: string
	operation_data?: string
	error_code?: number
	operation_user?: CometdMtEntity
	_isMonitorPopup?: boolean
	description?: string
}
export interface CometdMtEntity {
	account: string
	name?: string
	mt_key: string
	mt_id: string
	account_type: number
	conf_e164: string
	e164?: string
	mt_ip?: string
	portrait?: string
	protocol: number
	often_mt?: number
	stream?: number
	interactive_mt?: number
	online?: number
	bitrate?: number
	mt_type?: number
}
export type Msg =
	| 'err_mcu_confoverflow'
	| 'err_mcu_no_idle_mix'
	| 'err_mcu_spymtisunusualormodeerror'
	| 'err_mcu_oprinvalid_notsupportmulticascade'
	| 'err_mcu_no_idle_vmp'
	| 'err_mcu_callvrsrecfail'
	| 'err_mcu_resource_out'
	| 'err_mcu_repeat_filename'
	| 'err_mcu_file_out_ability'
	| 'err_mcu_confnotsupportmultispy'
	| 'err_mcu_confsndbandwidthisfull'
	| 'err_mcu_casdbasisnotenough'
	| 'err_mcu_casadeportfnotenough'
	| 'err_mcu_confstartvacpollmode'
	| 'err_mcu_vrs_notsupponlylive'
	| 'err_mcu_vrs_notenoughlivesource'
	| 'err_mcu_vrs_notenoughspace'
	| 'err_mcu_vrs_disconnected'
	| 'err_mcu_vrs_fileexception'
	| 'err_mcu_confplaying'
	| 'err_mcu_vrs_outdate'
	| 'err_mcu_vrs_limit'
	| 'err_mcu_vrs_smmatchsafecapfail'
	| 'err_vmp_no_vip_vmpchnnl'
	| 'err_mcu_pureconfforbidvmp'
	| 'err_mcu_pureconfforbidmix'
	| 'err_mcu_polling_nomtorvidsrc'
	| 'err_mcu_vrs_chgspymt'
	| 'err_mcu_exceeedvmpsinglenum'
	| 'err_mcu_selvidbasisnotenough'
	| 'err_mcu_vrs_addvrsmtfailed'
	| 'err_mcu_mcuisdumb'
	| 'err_mcu_vrs_vrsconnectfailed'
	| 'err_mcu_rollcall_calleeleft'
	| 'err_mcu_mediaresnotenough'
	| 'err_mcu_spymtstate_waitfree'
	| 'mcc_sysmsg_mtapplydiscuss'
	| 'mcc_sysmsg_mtapplyspeaker'
	| 'mcc_sysmsg_mtapplyadmin'

export interface ApplyMsgItem {
	/** 申请id */
	id: string
	/** 申请类型 */
	type: string
	/** 审批状态 1-待审批;2-同意;3-拒绝; */
	state: 1 | 2 | 3
	/** 申请时间 */
	created_at: string
	/** 操作人 */
	operation_user: MtEntity
}
